import App from './App'
import Vue from 'vue'
import StatusBar from '@/components/StatusBar.vue'
import BottomBar from '@/components/BottomBar.vue'
import Empty from '@/components/Empty.vue'
import ImgUpload from '@/components/ImgUpload.vue'
import HSelect from '@/components/HSelect.vue'
import util from '@/util/util.js'
import Json from '@/util/Json.js' //测试用数据
import {http,baseURL} from '@/util/http.js'
import constant from '@/util/constant.js'
//   ~@/static/icon/   已连续喝水天人参与喝水减塑活动个商户共享喝水点找水我的立即开通
Vue.component('StatusBar', StatusBar);
Vue.component('BottomBar', BottomBar);
Vue.component('Empty', Empty);
Vue.component('HSelect', HSelect);
Vue.component('ImgUpload', ImgUpload);

Vue.prototype.util = util;
Vue.prototype.Json = Json;
Vue.prototype.post = (url, data) => http('post', url, data)
Vue.prototype.get = (url, data) => http('get', url, data)
Vue.prototype.baseURL = baseURL
Vue.prototype.constant = constant
Vue.prototype.success = (msg = '成功！', duration = 1200) => util.success(msg,duration)
Vue.prototype.error = (msg = '失败！', duration = 1200) => util.error(msg,duration)
Vue.prototype.formatTime=(time)=>util.formatTime(time)
Vue.prototype.redirect=(url,delay)=>util.redirect(url,delay)
Vue.prototype.nav=(url,delay)=>util.nav(url,delay)
Vue.prototype.back=(url,delay)=>util.back(url,delay)
Vue.prototype.copy=(e)=>util.copy(e)
Vue.prototype.logout=(redirect)=>util.back(redirect)
Vue.prototype.call_tel=(tel)=>util.call_tel(tel)


Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()